XPath Format
The XPath is the path(s) to the repeating fields in the API response that correspond to the table(s) that you want to query.
XML Endpoints
Let's look at the following example document that might be returned for an XML endpoint:
<Contributors>
<Contributor>admin</Contributor>
<Contributor>ak</Contributor>
<Contributor>at</Contributor>
<Contributor>atlas</Contributor>
<Contributor>ok</Contributor>
<Contributor>us</Contributor>
<Contributor>uu</Contributor>
<Contributor>uw</Contributor>
</Contributors>
In this case, we want a table called contributor that contains all <Contributor> records. Therefore, the XPath needs to be the path to the repeating Contributor elements:
/Contributors/Contributor
You can create more than one table from a single XML response. Consider the following:
<Contributors>
<Contributor>
<name>admin</name>
<description>
<value1>type</value1>
<value2>1</value2>
</description>
</Contributor>
<Contributor>
<name>ak</name>
<description>
<value1>type</value1>
<value2>1</value2>
</description>
</Contributor>
<Contributor>
<name>at</name>
<description>
<value1>type</value1>
<value2>1</value2>
</description>
</Contributor>
<Contributor>
<name>atlas</name>
<description>
<value1>type</value1>
<value2>1</value2>
</description>
</Contributor>
</Contributors>
The xPath to the contributor table is still /Contributors/Contributor. We could also decide we want to create a second table for <description>. Its XPath would be /Contributors/Contributor/description. To include both tables in the XPath field, separate the two XPaths using a semicolon:
/Contributors/Contributor;/Contributors/Contributor/description
JSON Endpoints
In the case of JSON, we want to use JSONPath syntax to specify the XPath for the tables. Consider the following JSON example:
{
"catalogs": [
"38457511",
"=c",
"ak",
"at",
"atlas",
"av",
"cdmg",
"cgs",
"choy",
"ci",
"sc",
"se",
"unknown",
"us",
"ushis",
"uu",
"uw"
],
}
The start of the JSON object is represented as '$'. To specify that catalogs should be a table, we would construct the XPath as:
$.catalogs
You can specify multiple tables from one JSON response by separating their JSONPaths with a semicolon, similar to the second XML example above.